// © 2009 Microsoft Corporation.  All rights reserved.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.ServiceProcess;

namespace Microsoft.InformationSecurity.ISRM.TaskManagment.NotificationsService
{
    /// <summary>
    /// Service partial class
    /// </summary>
    public partial class NotificationService : ServiceBase
    {
        /// <summary>
        /// Public constructor.
        /// </summary>
        public NotificationService()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Public constructor.
        /// </summary>
        /// <param name="container">Container</param>
        public NotificationService(IContainer container)
        {
            container.Add(this);

            InitializeComponent();
        }

        /// <summary>
        /// Intializes service properties
        /// </summary>
        private void Init() 
        {
            this.ServiceName = ServiceConfiguration.ServiceName;
        }

        /// <summary>
        /// Invoked when service is started.
        /// </summary>
        /// <param name="args">Service Arguments</param>
        protected override void OnStart(string[] args)
        {
            ServiceManager.InitService();
        }

        /// <summary>
        /// Invoked when service is stopped.
        /// </summary>
        protected override void  OnStop()
        {
 	        ServiceManager.TerminateService();
        }

    }
}
